package com.woniuxy.controller.systemcontroller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.woniuxy.pojo.Permission;
import com.woniuxy.service.system.PermissionService;

@RestController
@RequestMapping("/pm")
public class PermissionController {

	@Autowired
	private PermissionService permissionService;
	@RequestMapping("/getPersTree")
	public Map<String, Object> getPersTree(Integer rid){
		Map<String,Object> map=new HashMap<String,Object>();
		List<Permission> list = permissionService.getPermissionByRoleId(rid);
		map.put("pers", list);
		map.put("tree", permissionService.getTree(0));
		return map;
	}
}
